import { Button } from "@/components/ui/button"
import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import Link from "next/link"
import { ArrowRight, Network, Sigma, Share2, AlertTriangle } from "lucide-react"

export default function Home() {
  // 算法分类
  const categories = [
    {
      id: "graph-generation",
      name: "动态异构图生成算法",
      description: "包含各类动态异构图的生成和基础运算算法",
      algorithms: [
        {
          id: "dynamic-graph-generation",
          name: "动态异构图展示",
          description: "支持10万级别多层动态异构网络的生成、存储与网络基本运算",
          icon: <Network className="h-8 w-8 text-primary" />,
        },
        {
          id: "dynamic-graph-facetnet",
          name: "FacetNet动态异构图生成算法",
          description: "基于FacetNet的动态异构图生成和社区发现算法，支持多时间步的动态网络分析",
          icon: <Share2 className="h-8 w-8 text-primary" />,
        },
      ]
    },
    {
      id: "anomaly-detection",
      name: "动态异构图分析算法",
      description: "：包含多种动态异构图的异常检测、链接预测、模式挖掘、演化预测等不少于10种算法并形成算法库；",
      algorithms: [
        {
          id: "hgcn-graph",
          name: "HGCN图生成算法",
          description: "基于HGCN的图生成算法，用于分类和社团检测",
          icon: <Network className="h-8 w-8 text-primary" />,
        },
        {
          id: "anomalous-edge-detection",
          name: "基于随机森林的异常边检测服务 (AEDS)",
          description: "基于随机森林的异常边检测算法，用于识别知识图谱中的异常连接关系",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "dynamic-heterogeneous-anomaly-detection",
          name: "动态异构图社区检测(DHCDS)算法",
          description: "基于图神经网络的动态异构图异常检测算法，用于识别动态异构图中的异常连接关系",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "MultiViewHeterogeneousAnomalyNodeDetection",
          name: "多视图异构图异常节点检测(MVHAN)算法",
          description: "基于多视图异构图异常节点检测(MVHAN)算法，用于识别图结构中异常的节点",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "TemporalHeterogeneousGraphAnomalyDetection",
          name: "时序异构图异常检测服务 (THGAD)",
          description: "基于时序异构图异常检测(THGAD)算法，用于识别图结构中异常的节点",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "MetaPathLinkPrediction",
          name: "元路径链接预测服务 (MPLP)",
          description: "基于元路径链接预测算法，用于预测图结构中节点之间的链接关系",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "TemporalHeterogeneousGraphRepresentationLearning",
          name: "时序异构图表示学习服务 (THGRL)",
          description: "基于时序异构图表示学习(THGRL)算法，用于学习图结构中节点的表示",
          icon: <Network className="h-8 w-8 text-primary" />,
        },
        {
          id: "TemporalSpatialGraphEmbedding",
          name: "时序空间图嵌入算法(TSGE)",
          description: "基于时序空间图嵌入(TSGE)算法，用于学习图结构中节点的表示",
          icon: <Network className="h-8 w-8 text-primary" />,
        },
        {
          id: "HeterogeneousGraphPatternMining",
          name: "异构图模式挖掘算法(HGPMS)",
          description: "基于异构图模式挖掘算法(HGPMS)，用于挖掘图结构中频繁出现的子图模式",
          icon: <Network className="h-8 w-8 text-primary" />,
        },
        {
          id: "EvolutionPredictService",
          name: "演化预测服务",
          description: "基于演化预测算法，用于预测图结构中节点的演化趋势",
          icon: <Network className="h-8 w-8 text-primary" />,
        },
      ]
    },
    {
      id: "risk-prevention",
      name: "风险防护算法",
      description: "包含数据流动风险防范和行业特定风险防护算法",
      algorithms: [
        // {
        //   id: "data-flow-risk",
        //   name: "数据流动风险防范优化算法",
        //   description: "包含针对不同场景的数据流动的案例库，不少于3种优化算法",
        //   icon: <Sigma className="h-8 w-8 text-primary" />,
        // },
        {
          id: "dynamicRiskPreventionAlgorithm",
          name: "基于动态风险评估的数据流防护算法(DRPA)",
          description: "基于动态风险评估的数据流防护算法(DRPA)，用于识别图结构中异常的节点",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "MedicalShareService",
          name: "医疗数据共享服务",
          description: "医疗数据共享服务，用于医疗数据共享",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
        {
          id: "BankRiskService",
          name: "银行风险服务",
          description: "银行风险服务，用于银行风险评估",
          icon: <AlertTriangle className="h-8 w-8 text-primary" />,
        },
      ]
    }
  ]

  return (
    <div className="container mx-auto py-10">
      <h1 className="text-3xl font-bold mb-8">算法管理平台</h1>
      <div className="space-y-12">
        {categories.map((category) => (
          <div key={category.id} className="space-y-4">
            <div className="border-b pb-2">
              <h2 className="text-2xl font-semibold">{category.name}</h2>
              <p className="text-muted-foreground">{category.description}</p>
            </div>
            <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
              {category.algorithms.map((algorithm) => (
                <Card key={algorithm.id} className="overflow-hidden">
                  <CardHeader className="pb-2">
                    <div className="mb-2">{algorithm.icon}</div>
                    <CardTitle>{algorithm.name}</CardTitle>
                    <CardDescription>{algorithm.description}</CardDescription>
                  </CardHeader>
                  <CardFooter className="pt-4">
                    <Link href={`/algorithms/${algorithm.id}`} className="w-full">
                      <Button className="w-full">
                        查看算法
                        <ArrowRight className="ml-2 h-4 w-4" />
                      </Button>
                    </Link>
                  </CardFooter>
                </Card>
              ))}
            </div>
          </div>
        ))}
      </div>
    </div>
  )
}

